<%@ page language="java" pageEncoding="UTF-8" %>

<!DOCTYPE html>
<html>
<head>
    <base href="${base}"/>
    <meta charset="UTF-8"/>
    <title>企业会员中心 - 人才系统</title>
    <link rel="shortcut icon" href="favicon.ico"/>
    <link href="styles/user.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<jsp:include page="../header.jsp"></jsp:include>
<!--导航 -->
<div class="floatnav">
    <jsp:include page="../nav.jsp"></jsp:include>
</div>
<!--导航end -->
<div class="page_location link_bk">

    当前位置：<a href="//">首页</a>&nbsp;>>&nbsp;<a href="company_index.php">会员中心</a>&nbsp;>>&nbsp;公司信息&nbsp;>>&nbsp;企业LOGO
</div>
<table width="985" border="0" align="center" cellpadding="0" cellspacing="0" style="margin-top:8px;">
    <tr>
        <td width="173" valign="top" class="link_bk">
            <jsp:include page="left.jsp"></jsp:include>
        </td>
        <td valign="top">
            <div class="user_right_box" style="padding-bottom:100px;">
                <div class="user_right_top_tit_bg">
                    <h1>企业LOGO</h1>
                </div>
                <form action="/company/logos" method="post" id="Form1" enctype="multipart/form-data">
                    <table width="100%" border="0" cellpadding="4" cellspacing="0">
                        <tr>
                            <td height="30" colspan="2"
                                style="padding-left:20px; color: #009900; line-height:200%;border-bottom:1px  #93C4DB dashed"
                                class="link_lan">LOGO是网站形象的重要体现，上传LOGO尺寸请不要超过300×110像素，图片大小不超过 500KB，允许格式：jpg/gif/png
                            </td>
                        </tr>
                    </table>
                    <table width="100%" border="0" cellpadding="4" cellspacing="0" id="upform">
                        <tr>

                            <td height="30" align="right">上传logo图片：</td>
                            <td>
                                <div class="layui-upload">
                                    <button type="button" class="layui-btn" id="test1">上传图片</button>
                                    <input type="submit" name="Submit" value="立即上传" id="up" class="layui-btn"/>
                                    <div class="layui-upload-list">
                                        <img class="layui-upload-img" id="demo1" style="height: 300px;width: 300px">
                                        <p id="demoText"></p>
                                    </div>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td height="30" align="right">&nbsp;</td>
                            <td></td>
                        </tr>
                    </table>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0"
                           style="margin-bottom:200px; margin-top:50px;line-height:180%; display:none; color:#009900"
                           id="upform_wait">
                        <tr>
                            <td height="40" align="center"><img src="//templates/default/images/30.gif" border="0"/>
                            </td>
                        </tr>
                        <tr>
                            <td height="20" align="center">正在上传，请稍后...</td>
                        </tr>
                    </table>
                    <input type="text" id="logo" name="logo" value="">
                </form>
            </div>
        </td>
    </tr>
</table>
<link rel="stylesheet" href="layui/css/layui.css" media="all">
<script src="layui/layui.js" charset="utf-8"></script>
<script src="js/jquery-2.0.3.js"></script>

<script>
    layui.use('upload', function () {
        var $ = layui.jquery
            , upload = layui.upload;

        //普通图片上传
        var uploadInst = upload.render({
            elem: '#test1'
            , url: '/files/logo'
            , before: function (obj) {
                //预读本地文件示例，不支持ie8
                obj.preview(function (index, file, result) {
                    $('#demo1').attr('src', result); //图片链接（base64）
                });
            }
            , done: function (res) {
                //如果上传失败
                if (res.code > 0) {
                    $("#logo").val(res.data)
                    return layer.msg('上传成功');
                }
                //上传成功
            }
            , error: function () {
                //演示失败状态，并实现重传
                var demoText = $('#demoText');
                demoText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>');
                demoText.find('.demo-reload').on('click', function () {
                    uploadInst.upload();
                });
            }
        });
    })
</script>
<jsp:include page="../footer.jsp"></jsp:include>
</body>
</html>

